﻿namespace MicroCloud.Utils
{
    /// <summary>
    /// 缓存数据
    /// </summary>
    public class CacheData
    {
        /// <summary>
        /// 初始化一个键值对数据 <see cref="CacheData"/> 的新实例
        /// </summary>
        public CacheData()
        { }

        /// <summary>
        /// 初始化一个键值对数据 <see cref="CacheData"/> 的新实例
        /// </summary>
        /// <param name="key">数据键</param>
        /// <param name="value">数据值</param>
        /// <param name="type">数据类型</param>
        /// <param name="group">数据分组</param>
        /// <param name="expiresUtc">过期时间UTC标准</param>
        public CacheData(object key, object value, object type, object group, DateTime? expiresUtc = null)
        {
            Key = key;
            Value = value;
            Type = type;
            Group = group;
            ExpiresUtc = expiresUtc;
        }

        #region 属性
        /// <summary>
        /// 获取或设置 数据键
        /// </summary>
        public object Key { get; set; }

        /// <summary>
        /// 获取或设置 数据值
        /// </summary>
        public object Value { get; set; }

        /// <summary>
        /// 获取或设置 数据类型
        /// </summary>
        public object Type { get; set; }

        /// <summary>
        /// 获取或设置 数据分组
        /// </summary>
        public object Group { get; set; }

        /// <summary>
        /// 获取或设置 过期时间（UTC标准）
        /// </summary>
        public DateTime? ExpiresUtc { get; set; }

        #endregion

    }
}